﻿using System;
using System.Collections.Generic;
using System.Text;
using YouHP.Model;
using YouHP.BLL;
using YouHP.Utility;

namespace YouHP.Pages.User
{
   public class PmSentbox:BasePage
    {
        protected List<MessageInfo> MsgList = new List<MessageInfo>();

        protected int pageIndex = 1;
        protected int pageSize = 15;
        protected int pageCount = 0;
        protected int dataCount = 0;
        protected string PagingString = "";

        protected override void ShowPage()
        {
            base.ShowPage();
            this.AddLocation("发件箱", "/User/PmSentbox.aspx");
            this.SetTitle("发件箱");

            if (IsPost) HandlePost();
            else HandleGet();
 

        }

        public void HandlePost()
        {
       


        }
        
        public void HandleGet()
        {

            pageIndex = RequestTools.GetQueryInt("page", 1);
            MsgList = MessageBLL.Instance.GetMessageListByUserId(pageSize, pageIndex, UserData.Id, false, out dataCount);
            pageCount = Utils.GetPageCount(dataCount, pageSize);

            string query = System.Web.HttpContext.Current.Request.Url.Query;
            query = Utils.RemoveQueryItem(query, "page");

            PagingString = this.GetPagingString(
                pageIndex,
                pageCount,
                "/User/PmSentbox.aspx" + query, "page");
        }
        
    }
}
